home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ShareWare OnLine 2
/
ShareWare OnLine Volume 2 (CMS Software)(1993).iso
/
prog
/
pbc22b.zip
/
PBC$BAS.ZIP
/
REPLACST.BAS
< prev
next >
Wrap
BASIC Source File
|
1993-01-01
|
878b
|
25 lines
' +----------------------------------------------------------------------+
' | |
' | PBClone Copyright (c) 1990-1993 Thomas G. Hanlin III |
' | |
' +----------------------------------------------------------------------+
SUB ReplaceString (St$, Old$, New$, Found%, ErrCode%)
Found% = 0
IF LEN(Old$) THEN
ErrCode% = 0
IF Old$ <> New$ THEN
tmp% = INSTR(St$, Old$)
IF tmp% THEN
DO
St$ = LEFT$(St$, tmp% - 1) + New$ + MID$(St$, tmp% + LEN(Old$))
tmp% = INSTR(tmp% + LEN(New$), St$, Old$)
LOOP WHILE tmp%
Found% = -1
END IF
END IF
ELSE
ErrCode% = -1
END IF
END SUB